package huawei2018;
import java.util.Scanner;
public class ChangeUperLower {
	public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str="";
        str=sc.nextLine();
        String srst=UpDown(str);
        System.out.println(srst);
    }


    public static String UpDown(String str){
        StringBuffer sb = new StringBuffer();
        char[] arr=str.toCharArray();
        for(int i = 0; i <= str.length()-1;i ++){
            char ch;
            if(arr[i] >= 'a' && arr[i] <= 'z'){
                ch = (char) (str.charAt(i)-32);
            }else if(arr[i] >= 'A' && arr[i] <= 'Z'){
                ch = (char) (str.charAt(i)+32);
            }else {
                ch = str.charAt(i);
            }
            sb.append(ch);
        }
        String trStr = sb.toString();
        return trStr;
    }
}
